package cbbx_sm.utils.ocr;

import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

import javax.imageio.ImageIO;

public class ocr {

	private static String imageFile =
			"/Volumes/Iomega_Ext Drive/20090528/14/14_20090528124924.jpg";
	
	public static void main (String[] args) throws Exception {

		BufferedImage targetBfImage = null;

	    try {
	    	targetBfImage = ImageIO.read(new File(imageFile));
	    } catch (IOException e) {
			e.printStackTrace();
			System.err.println(imageFile);
			return;
		}
	    int width = 165;
	    int hight = 15;
	    BufferedImage dest = new BufferedImage(width, hight, BufferedImage.TYPE_INT_RGB);
	    Graphics g = dest.getGraphics();
	    
	    g.drawImage(targetBfImage, 0, 0, width, hight, 0, 0, width, hight, null);
	    g.dispose();
	    
	    ImageIO.write(dest, "jpg", new FileOutputStream(new File("/Users/ronenvaisenberg/test.jpg")));

	}
}
